package ex_from_web;



/**
 * Java float primitive data type example
 */

public class float_example {
    static float x;
    
    public static void main(String[] args) {
        System.out.println("float default value: " + x);
        System.out.println("float max value: " + Float.MAX_VALUE);
        System.out.println("float min value: " + Float.MIN_VALUE);
        System.out.println("float type size: " + Float.SIZE + " bits");
        
        //Decimal value is promoted to double by default. 
        //Casting to float is needed
        float a=12.0f;
        float b=33.0f;
        System.out.println("++a = " + (++a));
        System.out.println("--b = " + (--b));
        System.out.println("a + b = " + (a + b));
        System.out.println("b - a = " + (b - a));
        System.out.println("a * a = " + (a * a));
        System.out.println("b / a = " + (b / a)); 
        System.out.println("b % a = " + (b % a)); 
    }

}